import request from "@/utils/request";
import type {
  RequestParams,
  ResponseData,
  inventoryPlanRequestParams,
} from "./type";

// 分页列表
export const inventoryPlanList = (data: RequestParams) => {
  return request<ResponseData<inventoryPlanRequestParams>, any>({
    url: "/api/v1/inventoryPlan/page",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const addinventoryPlan = (data: inventoryPlanRequestParams) => {
  return request<ResponseData<inventoryPlanRequestParams>, any>({
    url: "/api/v1/inventoryPlan/add",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const delinventoryPlan = (id: number) => {
  return request<ResponseData<inventoryPlanRequestParams>, any>({
    url: "/api/v1/inventoryPlan/delete",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const ForminventoryPlan = (id: number) => {
  return request<ResponseData<inventoryPlanRequestParams>, any>({
    url: "/api/v1/inventoryPlan/form",
    method: "post",
    data: id,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};

export const updateinventoryPlan = (data: inventoryPlanRequestParams) => {
  return request<ResponseData<inventoryPlanRequestParams>, any>({
    url: "/api/v1/inventoryPlan/update",
    method: "post",
    data,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const LibraryOptions = (aesKeyByRsa: string) => {
  return request<ResponseData<any>>({
    url: "/api/v1/library/options",
    method: "post",
    data: aesKeyByRsa,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const inventoryRouteOptions = (aesKeyByRsa: string) => {
  return request<ResponseData<any>>({
    url: "/api/v1/inventoryRoute/options",
    method: "post",
    data: aesKeyByRsa,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
export const inventoryTimeOptions = (aesKeyByRsa: string) => {
  return request<ResponseData<any>>({
    url: "/api/v1/inventoryTime/options",
    method: "post",
    data: aesKeyByRsa,
    headers: {
      //需要加密的请求在头部塞入标识
      isEncrypt: 1,
    },
  });
};
